package com.ztgf.commodity.service;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.ztgf.commodity.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.ztgf.commodity.mapper.ShieldBrandMapper;
import com.ztgf.commodity.models.service.IShieldBrandService;
import com.ztgf.commodity.models.bo.ShieldBrandSaveBO;
import com.ztgf.commodity.models.dto.ShieldBrandDTO;

/**
 * 盾构品牌表控制器
 *
 * @author chenyu.wang
 * @Date 2020-06-02 15:08:11
 */
@DubboService
public class ShieldBrandServiceImpl extends ServiceImpl<ShieldBrandMapper, ShieldBrandDTO> implements IShieldBrandService{

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(ShieldBrandSaveBO saveBO) {
        ShieldBrandDTO dto = new ShieldBrandDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
}
